/*
package com.zhou.app01.sys.db.datasource;

import com.alibaba.druid.pool.DruidDataSource;
import com.zhou.app01.util.EncryptUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MasterDataSource extends DruidDataSource {
    private String passwordDis;
    private String urlDis;
    private String userDis;
    private static final String KEY = "zhl-12#$";
    @Override
    public String getPassword(){
        if(StringUtils.isNotBlank(passwordDis)){return passwordDis;}
        String encPassword = super.getPassword();
        if(null==encPassword){
            return null;
        }
        passwordDis = EncryptUtil.decryptDES(encPassword,KEY);
        return passwordDis;
    }
    @Override
    public String getUrl(){
        if(StringUtils.isNotBlank(urlDis)){return urlDis;}
        String url = super.getUrl();
        if(null==url){
            return null;
        }
        urlDis = EncryptUtil.decryptDES(url,KEY);
        return urlDis;
    }
    @Override
    public String getUsername(){
        if(StringUtils.isNotBlank(userDis)){return userDis;}
        String username = super.getUsername();
        if(null==username){
            return null;
        }
        userDis = EncryptUtil.decryptDES(username,KEY);
        return userDis;
    }

    public static void main(String[] args) {
        String s;
        s=EncryptUtil.encryptDES("jdbc:mysql://localhost:3306/db?characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&rewriteBatchedStatements=true",KEY);
        System.out.println(s);
        s=EncryptUtil.encryptDES("root",KEY);
        System.out.println(s);
        s=EncryptUtil.encryptDES("mysqladmin",KEY);
        System.out.println(s);
    }
}
*/
